<include file="Public/min-header"/>
<div class="wrapper">
  <include file="Public/breadcrumb"/>
    <section class="content">
        <!-- Main content -->
        <div class="container-fluid">
            <div class="pull-right">
                <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default" data-original-title="返回"><i class="fa fa-reply"></i></a>
           		<a href="javascript:;" class="btn btn-default" data-url="http://www.tp-shop.cn/Doc/Index/article/id/334/developer/user.html" onclick="get_help(this)"><i class="fa fa-question-circle"></i> 帮助</a>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-list"></i> 前台导航</h3>
                </div>
                <div class="panel-body">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab_tongyong" data-toggle="tab">前台导航</a></li>
                    </ul>
                    <!--表单数据-->
                    <form method="post" id="addEditNavForm"  onsubmit="return checkName();">                    
                        <!--通用信息-->
                    <div class="tab-content">                 	  
                        <div class="tab-pane active" id="tab_tongyong">
                           
                            <table class="table table-bordered">
                                <tbody>
                                <tr>
                                    <td>系统内容:</td>
                                    <td>
                                         <select id="system_nav" name="system_nav" class="form-control" style="width:250px;">
                                                <option value="">自定义导航</option>
                                                <foreach name="system_nav"  key='k' item="v" >
                                                    <option value="{$k}"<if condition="$k eq $navigation[url]"> selected </if> >{$v}</option>
                                                </foreach>                                                
                                         </select>
                                    </td>
                                </tr>                                
                                <tr>
                                    <td>导航名称（繁体）:</td>
                                    <td>
                                        <input type="text" value="{$navigation.name}" name="name" class="form-control" style="width:250px;"/>
                                        <span id="err_name" style="color:#F00; display:none;">导航名称不能为空!!</span>                                        
                                    </td>
                                </tr>                      
                                <tr>
                                    <td>导航名称（日语）:</td>
                                    <td>
                                        <input type="text" value="{$navigation.name_jp}" name="name_jp" class="form-control" style="width:250px;"/>
                                                              
                                    </td>
                                </tr> 
   
                                <tr>
                                    <td>链接:</td>
                                    <td>
                                        <input type="text" value="{$navigation.url}" name="url" class="form-control" />
                                        <span id="err_url" style="color:#F00; display:none;"></span>
                                    </td>
                                </tr> 
                                <tr>
                                    <td>排序:</td>
                                    <td>
                                        <input type="text" value="{$navigation.sort}" name="sort" class="form-control" style="width:200px;" placeholder="50"/>                               
                                    </td>
                                </tr>                                                             
                                </tbody>                                
                                </table>
                        </div>                           
                    </div>              
                    <div class="pull-right">
                        <input type="hidden" name="id" value="{$navigation.id}">
                        <button class="btn btn-primary" title="" data-toggle="tooltip" type="submit" data-original-title="保存">保存</button>
                    </div>
			    </form><!--表单数据-->
                </div>
            </div>
        </div>    <!-- /.content -->
    </section>
</div>
<script>
// 判断输入框是否为空
function checkName(){
	var name = $("#addEditNavForm").find("input[name='name']").val();
    if($.trim(name) == '')
	{
		$("#err_name").show();
		return false;
	}
	return true;
}
// 更改系统内容
$("#system_nav").change(function(){	
	var text = $(this).find("option:selected").text();
	text = text.replace(/-/ig,""); 
	var val  = $(this).find("option:selected").val();	
	$("input[name='name']").val(text);
	$("input[name='url']").val(val);	
});
</script>

</body>
</html>